import { GETMOVIELIST } from "../constants/movieConstants";
//定义reducer的初始值
const init = {
    movieList: []
}
export default function movieReducer(prevState = init, action) {
    //接受action对象的type和data
    const { type, data } = action;
    console.log(action);
    switch (type) {
        case GETMOVIELIST:
        return {
            ...prevState,
            movieList:data
        }
    }
    return prevState
}